﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UnitSoftware.LINQ2SQLExtentions
{
    public class SpecificEntityTypeEventSource : EntityTypeEventSource
    {
        Type _type;

        public SpecificEntityTypeEventSource(DataChangeProcessor processor, Type type) : base(processor)
        {
            _type = type;
        }

        protected override void OnEntitiesDeleted(IList<object> entities)
        {
            foreach (object entity in e.Entities)
                if (entity.GetType().Equals(_type))
                {
                    EntityTypeDeleted(this, EventArgs.Empty);
                    return;
                }
        }        
    }
}
